home *** CD-ROM | disk | FTP | other *** search
/ Chip: Hang es video / CHIP_ZENESZERKESZTO_2005.ISO / audio_3 / visual / robotfunk / setup.exe / {app} / main.dxr / ui_234.ls < prev    next >
Encoding:
Text File  |  2003-11-19  |  1.3 KB  |  60 lines

  1. property spriteNum, loop, numframes, inframe, outframe, mylist, Dir, pos, playin, oldpos, mycount
  2. global curscript
  3.  
  4. on beginSprite me
  5.   loop = 0
  6.   mylist = []
  7.   numframes = 0
  8.   inframe = 1
  9.   outframe = 1
  10.   Dir = 1
  11.   pos = 0
  12.   oldpos = pos
  13.   playin = 0
  14.   mycount = 0
  15. end
  16.  
  17. on changelist me, whatlist
  18.   mylist = whatlist
  19.   inframe = 1
  20.   outframe = mylist.count
  21.   mycount = outframe
  22.   member("endfield").text = string(outframe)
  23.   pos = 1
  24.   member("current_point_field").text = string(pos)
  25. end
  26.  
  27. on exitFrame me
  28.   curscript = "curpont"
  29.   if playin then
  30.     if mylist.count > 0 then
  31.       pos = pos + Dir
  32.       if pos < inframe then
  33.         if loop then
  34.           pos = outframe
  35.         else
  36.           pos = inframe
  37.           playin = 0
  38.         end if
  39.       else
  40.         if pos > outframe then
  41.           if loop then
  42.             pos = inframe
  43.           else
  44.             pos = outframe
  45.             playin = 0
  46.           end if
  47.         else
  48.         end if
  49.       end if
  50.     end if
  51.   end if
  52.   if oldpos <> pos then
  53.     newloc = sprite(spriteNum + 10).left + (pos / float(mycount) * sprite(spriteNum + 10).width)
  54.     sprite(spriteNum + 11).locH = newloc
  55.     sprite(spriteNum).member.image.copyPixels(mylist[pos], sprite(spriteNum).member.image.rect, mylist[pos].rect)
  56.     member("current_point_field").text = string(pos)
  57.     oldpos = pos
  58.   end if
  59. end
  60.